<template>
	<view v-for="(item,index) in layman" :key="index" :style="{background:item.background}">{{item.obscure}}</view>
	<view class="title"><text @click="togglecolor">点击更换文字颜色</text></view>
</template>

<script setup>
	import { ref } from 'vue'
	// 第一种
	const layman = ref([
		{obscure:"degrade",eccemtric:"rot",background:"#ff9999"},
		{obscure:"prescient",eccemtric:"bewilder",background:"#ffb399"},
	])
	// 第二种
	const colorc = ref("#003300")
	const togglecolor = () => colorc.value = '#00cc00'
</script>

<style>
	.title{color:v-bind('colorc')}
</style>